home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / FLTK-1.0.6 / test / fast_slow.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-27  |  1.5 KB  |  49 lines

  1. // generated by Fast Light User Interface Designer (fluid) version 1.00
  2.  
  3. #include "fast_slow.h"
  4.  
  5. Fl_Slider *control=(Fl_Slider *)0;
  6.  
  7. static void cb_control(Fl_Slider* o, void*) {
  8.   fast->value(o->value());
  9. if (!Fl::pushed()) slow->value(o->value());
  10. }
  11.  
  12. Fl_Slider *fast=(Fl_Slider *)0;
  13.  
  14. Fl_Slider *slow=(Fl_Slider *)0;
  15.  
  16. int main(int argc, char **argv) {
  17.   Fl_Window* w;
  18.   { Fl_Window* o = new Fl_Window(318, 443);
  19.     w = o;
  20.     { Fl_Slider* o = control = new Fl_Slider(90, 200, 30, 200, "move\nthis");
  21.       o->callback((Fl_Callback*)cb_control);
  22.       o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);
  23.     }
  24.     { Fl_Slider* o = fast = new Fl_Slider(140, 200, 30, 200, "fast\nredraw");
  25.       o->set_output();
  26.     }
  27.     { Fl_Slider* o = slow = new Fl_Slider(190, 200, 30, 200, "slow\nredraw");
  28.       o->set_output();
  29.     }
  30.     { Fl_Box* o = new Fl_Box(10, 10, 300, 180, "The left slider has changed( FL_WHEN_CHANGED | FL_WHEN_RELEASE | FL_WHEN_N\
  31. OT_CHANGED) so it produces a callback on both drag and release mouse events\
  32. .\nThe middle slider (representing a widget with low overhead) is changed o\
  33. n every mouse movement.\nThe right slider (representing a widget with high \
  34. overhead) is only updated when the mouse is released, by checking if Fl::pu\
  35. shed() is zero.");
  36.       o->box(FL_DOWN_BOX);
  37.       o->color(53);
  38.       o->selection_color(47);
  39.       o->labelfont(4);
  40.       o->labelsize(12);
  41.       o->align(132|FL_ALIGN_INSIDE);
  42.     }
  43.     o->end();
  44.     o->resizable(o);
  45.   }
  46.   w->show(argc, argv);
  47.   return Fl::run();
  48. }
  49.